package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HikVideoAllGroupFlowNewMapper;
import com.ruoyi.system.domain.HikVideoAllGroupFlowNew;
import com.ruoyi.system.service.IHikVideoAllGroupFlowNewService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客流信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-14
 */
@Service
public class HikVideoAllGroupFlowNewServiceImpl implements IHikVideoAllGroupFlowNewService
{
    @Autowired
    private HikVideoAllGroupFlowNewMapper hikVideoAllGroupFlowNewMapper;

    /**
     * 查询客流信息
     *
     * @param id 客流信息主键
     * @return 客流信息
     */
    @Override
    public HikVideoAllGroupFlowNew selectHikVideoAllGroupFlowNewById(Long id)
    {
        return hikVideoAllGroupFlowNewMapper.selectHikVideoAllGroupFlowNewById(id);
    }

    /**
     * 查询客流信息列表
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 客流信息
     */
    @Override
    public List<HikVideoAllGroupFlowNew> selectHikVideoAllGroupFlowNewList(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew)
    {
        return hikVideoAllGroupFlowNewMapper.selectHikVideoAllGroupFlowNewList(hikVideoAllGroupFlowNew);
    }

    /**
     * 新增客流信息
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 结果
     */
    @Override
    public int insertHikVideoAllGroupFlowNew(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew)
    {
        hikVideoAllGroupFlowNew.setCreateTime(DateUtils.getNowDate());
        return hikVideoAllGroupFlowNewMapper.insertHikVideoAllGroupFlowNew(hikVideoAllGroupFlowNew);
    }

    /**
     * 修改客流信息
     *
     * @param hikVideoAllGroupFlowNew 客流信息
     * @return 结果
     */
    @Override
    public int updateHikVideoAllGroupFlowNew(HikVideoAllGroupFlowNew hikVideoAllGroupFlowNew)
    {
        hikVideoAllGroupFlowNew.setUpdateTime(DateUtils.getNowDate());
        return hikVideoAllGroupFlowNewMapper.updateHikVideoAllGroupFlowNew(hikVideoAllGroupFlowNew);
    }

    /**
     * 批量删除客流信息
     *
     * @param ids 需要删除的客流信息主键
     * @return 结果
     */
    @Override
    public int deleteHikVideoAllGroupFlowNewByIds(String ids)
    {
        return hikVideoAllGroupFlowNewMapper.deleteHikVideoAllGroupFlowNewByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客流信息信息
     *
     * @param id 客流信息主键
     * @return 结果
     */
    @Override
    public int deleteHikVideoAllGroupFlowNewById(Long id)
    {
        return hikVideoAllGroupFlowNewMapper.deleteHikVideoAllGroupFlowNewById(id);
    }

    /**
     * 查询今日客流
     * @param time
     * @return
     */
    @Override
    public Integer countTodayFlow(String time) {
        return hikVideoAllGroupFlowNewMapper.countTodayFlow(time);
    }

    /**
     * 查询近7天客流
     * @return
     */
    @Override
    public Integer sevenFlow() {
        return hikVideoAllGroupFlowNewMapper.sevenFlow();
    }

    /**
     * 根据添加时间查询客流信息
     * @param dateStr
     * @return
     */
    @Override
    public HikVideoAllGroupFlowNew selectHikVideoAllGroupFlowNewByAddTime(String dateStr) {
        return hikVideoAllGroupFlowNewMapper.selectHikVideoAllGroupFlowNewByAddTime(dateStr);
    }
}
